package router

import (
	"github.com/gin-gonic/gin"
	_ "github.com/gin-gorm-oj/docs"
	"github.com/gin-gorm-oj/server"
	swaggerfiles "github.com/swaggo/files"
	ginSwagger "github.com/swaggo/gin-swagger"
)

func Router() *gin.Engine {
	r := gin.Default()

	//swagger 配置
	r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler))
	//路由规则
	r.GET("/ping", server.Ping)
	r.GET("/problem-list", server.GetProblemList)
	r.GET("/problem-detail", server.GetProblemDetail)
	return r
}
